<%--
  Created by IntelliJ IDEA.
  User: 86153
  Date: 2023/3/21
  Time: 10:01
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + request.getContextPath() + "/";
%>


<html>
  <head>
    <base href="<%=basePath%>">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <link rel="stylesheet" type="text/css" href="css/css.css"/>
    <script type="text/javascript" src="js/jquery.min.js"></script>
    <script src="js/jquery-3.6.0.js"></script>
    <script>
      function insert_Enterprise(e){
        var formObject = {};
        var formArray =$("#form2").serializeArray();
        $.each(formArray,function(i,item){
          formObject[item.name] = item.value;
        });
        $.ajax({
          url:'admin_info/insert_Enterprise',
          headers: {
            'Content-Type': 'application/json;charset=utf-8',
          },
          type:'POST',
          data:JSON.stringify(formObject),
          dataType: "json",
          success: function (data) {
            if(data.code=='0000'){
              alert("添加失败，请重试");
              window.location.reload();
            }else if(data.code=='0001'){
              alert("添加成功");
              window.location.href='jsp/admin_view.jsp';
            }else if(data.code=='0002'){
              alert("请输入信息");
              window.location.reload();
            }else if(data.code=='0003'){
              alert("账号已存在，请重新输入！");
              window.location.reload();
            }
          }
        })
      }
    </script>
    <style>
      .baBody1 {
        margin-top: 20px;
        margin-left: 35%;
      }

    </style>
  </head>
  <body>
  <div id="pageAll">

    <div class="page ">
      <!-- 会员注册页面样式 -->
      <div class="banneradd bor">
        <div class="baTopNo">
          <span>添加企业信息</span>
        </div>
        <form id="form2">
          <div class="baBody1">
            <div class="bbD">
                   企业名称：<input type="text" class="input3" name="comName" placeholder="输入企业名称"/>
            </div>
            <div class="bbD">
                   企业地点：<input type="text" class="input3" name="comLocal" placeholder="输入企业地点"/>
            </div>
            <div class="bbD">
                   招聘要求：<input type="text" class="input3" name="recruitmentRequirements" placeholder="输入招聘要求"/>
            </div>
            <div class="bbD">
                   招聘岗位：<input type="text" class="input3" name="recruitmentPositions" placeholder="输入招聘岗位"/>
            </div>
            <div class="bbD">
                   薪资范围：<input type="text" class="input3" name="salaryRange" placeholder="输入薪资范围"/>
            </div>
            <div class="bbD">
                   公司账号：<input type="text" class="input3" name="comAccount" placeholder="输入公司账号"/>
            </div>
            <div class="bbD">
                   账号密码：<input type="text" class="input3" name="comPassword" placeholder="输入账号密码"/>
            </div>
            <div class="bbD">
              <p class="bbDP">
                <span class="btn_ok btn_yes" onclick="insert_Enterprise()"><input type="hidden"/>提交</span>
                <a class="btn_ok btn_no" href="jsp/admin_view.jsp">取消</a>
              </p>
            </div>


          </div>
        </form>
      </div>
    </div>
  </div>

  </body>
</html>
